using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using DAL;
using BUS;
using DTO;
using Utility;

public partial class admin_A_thongtintuyendung : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (IsPostBack)
        {
            LoadData();
        }
    }

    private void LoadData()
    {
        Pager.PageSize = 1;
        Criteria c = new Criteria();

        if (txt_TenUV.Text != null)
        {
            c.add(Condition.AND, ThongTinTuyenDungColumns.ID, Condition.LIKE,
                txt_TenUV.Text);

        }
        int total = 0;
        ThongTinTuyenDungCollection tuyendungCollection =
           ThongTinTuyenDung_BUS.Get(c.Criter, Pager.CurrentIndex, Pager.PageSize,
           ThongTinTuyenDungColumns.ID.ToString(), OrderDirection.ASC.ToString(), out total);
        Repeater1.DataSource = tuyendungCollection;
        Repeater1.DataBind();

        Pager.ItemCount = total;
    }
    protected void lbt_Xoa_Click(object sender, EventArgs e)
    {

    }
    protected void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        if (e.Item.ItemType == ListItemType.AlternatingItem ||
          e.Item.ItemType == ListItemType.Item)
        {
            ThongTinTuyenDung_DTO tuyendung = (ThongTinTuyenDung_DTO)e.Item.DataItem;
            Literal hyp_vitri = (Literal)e.Item.FindControl("hyp_vitri");
            Literal lit_yc = (Literal)e.Item.FindControl("lit_yc ");
            Literal lit_luong = (Literal)e.Item.FindControl("lit_luong");
            Literal lit_hoso = (Literal)e.Item.FindControl("lit_hoso");


            HyperLink hpl_edit = (HyperLink)e.Item.FindControl("hpl_edit");

            hpl_edit.NavigateUrl = "~/Admin/chitiet_tuyendung.aspx?id" + tuyendung.ID.ToString();

        }
    }
    protected void Pager_Command(object sender, CommandEventArgs e)
    {

        Pager.CurrentIndex = int.Parse(e.CommandArgument.ToString());
        LoadData();
    }
}
